Skip to content

refactor(go): schedule 모듈 내부를 gocron v2로 마이그레이션#257

Merged
kubrickcode merged 2 commits intomainfrom
develop/shlee/187
Nov 27, 2025
Merged

refactor(go): schedule 모듈 내부를 gocron v2로 마이그레이션#257
kubrickcode merged 2 commits intomainfrom
develop/shlee/187

Conversation

@kubrickcode
Copy link
Owner

기존 time.Ticker 기반 커스텀 스케줄러의 goroutine leak 문제와 graceful shutdown 미지원 문제를 해결하기 위해 gocron v2로 교체

  • gocron v2 라이브러리로 내부 구현 교체
  • SIGTERM/SIGINT 시그널 핸들링으로 graceful shutdown 지원
  • k0kubun/pp 의존성 제거
  • schedule 모듈 테스트 코드 추가

fix #187

기존 time.Ticker 기반 커스텀 스케줄러의 goroutine leak 문제와 graceful shutdown 미지원 문제를 해결하기 위해 gocron v2로 교체

- gocron v2 라이브러리로 내부 구현 교체
- SIGTERM/SIGINT 시그널 핸들링으로 graceful shutdown 지원
- k0kubun/pp 의존성 제거
- schedule 모듈 테스트 코드 추가

fix #187
@github-actions github-actions bot added the refactor Refactoring code label Nov 27, 2025
@kubrickcode
Copy link
Owner Author

/gemini review

@gemini-code-assist
Copy link

Summary of Changes

Hello @kubrickcode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 애플리케이션의 스케줄링 메커니즘을 개선하는 중요한 리팩토링을 수행합니다. 기존의 수동적인 스케줄러 구현에서 발생하는 잠재적인 문제점들을 해결하기 위해 검증된 외부 라이브러리인 gocron v2를 도입했습니다. 이를 통해 스케줄링 작업의 안정성과 효율성을 높이고, 애플리케이션의 전반적인 견고성을 향상시키는 것을 목표로 합니다. 또한, 시스템 종료 시 실행 중인 작업을 안전하게 마무리할 수 있는 기능을 추가하여 운영 환경에서의 안정성을 강화했습니다.

Highlights

  • 스케줄러 라이브러리 마이그레이션: 기존 time.Ticker 기반의 커스텀 스케줄러를 gocron v2 라이브러리로 교체하여 goroutine leak 문제와 graceful shutdown 미지원 문제를 해결했습니다.
  • Graceful Shutdown 지원: SIGTERM/SIGINT 시그널 핸들링을 추가하여 애플리케이션 종료 시 스케줄러가 작업을 안전하게 중단할 수 있도록 graceful shutdown을 지원합니다.
  • 불필요한 의존성 제거: 더 이상 사용되지 않는 k0kubun/pp 의존성을 제거하여 프로젝트의 복잡성을 줄였습니다.
  • 스케줄 모듈 테스트 코드 추가: schedule 모듈에 대한 단위 테스트 코드를 추가하여 스케줄러의 기능과 안정성을 검증합니다.
  • 의존성 업데이트: 여러 go.modgo.sum 파일에서 golang.org/x/crypto, golang.org/x/sys, golang.org/x/text 등의 Go 표준 라이브러리 관련 의존성 버전이 업데이트되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@kubrickcode kubrickcode linked an issue Nov 27, 2025 that may be closed by this pull request
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

schedule 모듈을 time.Ticker 기반의 자체 구현에서 gocron/v2 라이브러리를 사용하도록 리팩터링한 점이 인상적입니다. 이를 통해 기존에 존재하던 goroutine leak 문제와 graceful shutdown 미지원 문제를 해결하고 코드의 안정성과 유지보수성을 크게 향상시켰습니다. 또한, SIGTERM/SIGINT 시그널을 처리하여 graceful shutdown을 구현한 부분과 관련 테스트 코드를 추가한 점도 매우 좋습니다. 전반적으로 훌륭한 개선이지만, 코드 가독성을 높이기 위해 한 가지 제안 사항이 있습니다. schedule.go 파일 내에 하드코딩된 타임아웃 값을 상수로 추출하여 관리하는 것을 고려해 보세요.

@kubrickcode kubrickcode merged commit 1a5ed80 into main Nov 27, 2025
10 checks passed
@kubrickcode kubrickcode deleted the develop/shlee/187 branch November 27, 2025 12:32
@kubrickcode
Copy link
Owner Author

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring code released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gocron v2 마이그레이션 Go 서비스 리팩토링

1 participant